<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html>
<head>
<link type="text/css"
	href="/phoenix/js/jquery-ui/css/ui-lightness/jquery-ui-1.8.23.custom.css"
	rel="Stylesheet" />
<script type="text/javascript"
	src="/phoenix/js/jquery-ui/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript"
	src="/phoenix/js/jquery-ui/js/jquery-ui-1.8.23.custom.min.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		console.log('sss');
		$(".delete1").dialog({
			modal : true,
			bgiframe : true,
			width : 500,
			height : 200,
			autoOpen : false
		});

		$(".delete1").click(function(e) {
			console.log("sdsds");
			e.preventDefault();
			var theHREF = $(this).attr("href");

			$(".delete").dialog('option', 'buttons', {
				"Confirm" : function() {
					window.location.href = theHREF;
				},
				"Cancel" : function() {
					$(this).dialog("close");
				}
			});

			$(".del_schedule_url").dialog("open");

		});
	});
</script>
<link href="<c:url value='/css/main.css'/>" rel="stylesheet"
	type="text/css" />
<fmt:setBundle basename="ApplicationResources" />
<title><fmt:message key="label.crudschedule" /></title>

</head>
<body>
	<h1>
		<fmt:message key="label.crudschedule" />
	</h1>
	<c:url var="url" scope="page" value="/controller/addschedule">
		<c:param name="program_id" value="" />
		<c:param name="start_time" value="" />
		<c:param name="end_time" value="" />
		<c:param name="presenter_id" value="" />
		<c:param name="producer_id" value="" />
		<c:param name="insert" value="true" />
	</c:url>
	<a href="${url}"><fmt:message key="label.crudschedule.add" /></a>

	<br />
	<br />
	<table class="borderAll">
		<tr>
			<th><fmt:message key="label.crudschedule.schedule_id" /></th>
			<th><fmt:message key="label.crudschedule.program_name" /></th>
			<th><fmt:message key="label.crudschedule.start_time" /></th>
			<th><fmt:message key="label.crudschedule.end_time" /></th>
			<th><fmt:message key="label.crudschedule.presenter" /></th>
			<th><fmt:message key="label.crudschedule.producer" /></th>

			<th><fmt:message key="label.crudschedule.edit" /></th>
			<th><fmt:message key="label.crudschedule.delete" /></th>
			<th><fmt:message key="label.crudschedule.copy" /></th>
		</tr>
		<c:forEach var="crudschedule" items="${schedules}" varStatus="status">
			<tr class="${status.index%2==0?'even':'odd'}">
				<td class="nowrap">${crudschedule.scheduleId}</td>
				<td class="nowrap">${crudschedule.program.name}</td>
				<td class="nowrap">${crudschedule.startDate}</td>
				<td class="nowrap">${crudschedule.endDate}</td>
				<td class="nowrap">${crudschedule.presenter.name}</td>
				<td class="nowrap">${crudschedule.producer.name}</td>

				<td><c:url var="editurl" scope="page"
						value="/controller/editschedule">
						<c:param name="schedule_id" value="${crudschedule.scheduleId}" />
					</c:url> <a href="${editurl}"><fmt:message
							key="label.crudschedule.edit" /></a></td>



				<td><c:url var="delurl" scope="page"
						value="/controller/deleteschedule">
						<c:param name="schedule_id" value="${crudschedule.scheduleId}" />
					</c:url> <a href="${delurl}"><fmt:message
							key="label.crudschedule.delete" /></a></td>

				<td><c:url var="copyurl" scope="page"
						value="/controller/copyschedule">
						<c:param name="schedule_id" value="${crudschedule.scheduleId}" />
					</c:url> <a href="${copyurl}"><fmt:message
							key="label.crudschedule.copy" /></a></td>

			</tr>
		</c:forEach>



	</table>


</body>
</html>